package com.aep.provisioning.service;

import java.util.Date;
import java.util.List;

import com.aep.provisioning.controller.form.ContactForm;
import com.aep.provisioning.dao.CommonDAO;
import com.aep.provisioning.domain.Contact;
import com.aep.provisioning.domain.Geography;

public class CommonServiceImpl implements CommonService{

	private CommonDAO commonDAO;

	public void saveContract(ContactForm contactForm){
		Contact contact = new Contact();
		contact.setDateCreated(new Date(System.currentTimeMillis()));
		contact.setDateLastUpdated(new Date(System.currentTimeMillis()));
		contact.setCreatedBy("YO");
		contact.setName(contactForm.getName());
		contact.setPhone(contactForm.getPhone());
		contact.setEmail(contactForm.getEmail());
		contact.setInterest(contactForm.getInterest());
		commonDAO.saveContact(contact);
	}
	
	public List<Geography> listDepartamentos(){
		return commonDAO.listDepartamentos();
	}

	public List<Geography> listProvincias(Long idDepartamento){
		return commonDAO.listProvincias(idDepartamento);
	}
	public void setCommonDAO(CommonDAO commonDAO) {
		this.commonDAO = commonDAO;
	}
	
	
	
}
